Telegram Group & Telegram Channel
💪 #tip
When using security() and you want to avoid repainting, remember that it's critical to use two techniques TOGETHER:
1. Offset the series with [1]
2. Use lookahead = barmerge.lookahead_on

noRepaintAndNoFutureData  = security(syminfo.tickerid, "D", close[1], lookahead = barmerge.lookahead_on)

We see code in scripts that uses lookahead on but doesn't offset the series, which produces 2 adverse effects:
a) Future data is used on historical bars, which let's your script cheat and misleads traders, as there is no way your code can reproduce that behavior in realtime, because there are no future bars to cheat with then.
b) The value will repaint in realtime.

//@version=4
study("", "", true)
noRepaintAndNoFutureData = security(syminfo.tickerid, "D", close[1], lookahead = barmerge.lookahead_on)
repaintsAndUsesFutureData = security(syminfo.tickerid, "D", close, lookahead = barmerge.lookahead_on)
plot(noRepaintAndNoFutureData, "Good", color.green, 2)
plot(repaintsAndUsesFutureData, "Bad", color.red, 2)

https://www.tradingview.com/x/hkfEyExW/



tg-me.com/PineCodersSquawkBox/58
Create:
Last Update:

💪 #tip
When using security() and you want to avoid repainting, remember that it's critical to use two techniques TOGETHER:
1. Offset the series with [1]
2. Use lookahead = barmerge.lookahead_on

noRepaintAndNoFutureData  = security(syminfo.tickerid, "D", close[1], lookahead = barmerge.lookahead_on)

We see code in scripts that uses lookahead on but doesn't offset the series, which produces 2 adverse effects:
a) Future data is used on historical bars, which let's your script cheat and misleads traders, as there is no way your code can reproduce that behavior in realtime, because there are no future bars to cheat with then.
b) The value will repaint in realtime.

//@version=4
study("", "", true)
noRepaintAndNoFutureData = security(syminfo.tickerid, "D", close[1], lookahead = barmerge.lookahead_on)
repaintsAndUsesFutureData = security(syminfo.tickerid, "D", close, lookahead = barmerge.lookahead_on)
plot(noRepaintAndNoFutureData, "Good", color.green, 2)
plot(repaintsAndUsesFutureData, "Bad", color.red, 2)

https://www.tradingview.com/x/hkfEyExW/

BY PineCoders Squawk Box




Share with your friend now:
tg-me.com/PineCodersSquawkBox/58

View MORE
Open in Telegram


PineCoders Squawk Box Telegram | DID YOU KNOW?

Date: |

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.

PineCoders Squawk Box from sg


Telegram PineCoders Squawk Box
FROM USA